package com.dhcc.core.framework.constant.state;

/**
 * 资源类型的枚举
 * 
 * @ClassName: ResourceType
 * @Description: TODO
 * @author: cyf
 * @date: 2018年1月2日 上午9:17:04
 */
public enum ResourceType {

    // 目录
    CATALOG(1, "目录"),
    // 菜单
    MENU(2, "菜单"),
    // 权限
    PERMISSION(3, "权限");

    int code;
    String message;

    ResourceType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer status) {
        if (status == null) {
            return "";
        } else {
            for (ResourceType s : ResourceType.values()) {
                if (s.getCode() == status) {
                    return s.getMessage();
                }
            }
            return "";
        }
    }
}
